package com.ljf.spring.sso;

import com.ljf.sso.SsoClientConfig;
import com.ljf.sso.SsoServerConfig;
import com.ljf.sso.SsoManager;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * 说明：sso注册
 *
 * @Auther: lijinfeng
 * @Date: 2024/4/24
 */
@ConditionalOnClass(SsoManager.class)
public class SsoBeanRegister {
    /**
     * 获取 SSO 配置Bean
     * @return 配置对象
     */
    @Bean
    @ConfigurationProperties(prefix = "ljf.sso.server")
    public SsoServerConfig getSsoServerConfig() {
        return new SsoServerConfig();
    }

    @Bean
    @ConfigurationProperties(prefix = "ljf.sso.client")
    public SsoClientConfig getSsoClientConfig() {
        return new SsoClientConfig();
    }

}
